package elements;

import be.kuleuven.cs.som.annotate.Basic;

/**
 * @invar	| this.isTerminated() || !this.isTerminated()
 * 
 * @version	3.0
 * @author 	Lies Tambeur 	r0264469	2Bcwsbbh
 * @author	Eline Vanrykel	r0264543	2Bcwselt
 *
 */
public abstract class Terminatable { 
	
	/**
	 * @post	| !new.isTerminated()
	 */
	protected Terminatable(){
		
	}
	
	private boolean terminated = false;
	
	/**
	 * @post	| new.isTerminated()
	 */
	protected void setTerminate(){
		terminated=true;
	}
	
	/**
	 * @effect	| this.setTerminate()
	 */
	public abstract void terminate();
	
	/**
	 * @return	| result == this.terminated
	 */
	@Basic
	public boolean isTerminated(){
		return terminated;
	}
	
}
